package regexp;

import java.io.*;

/**
 * @author DCSGO
 * @version 1.0
 */
public class ReadContent {
    public static String getContent(String filePath) {
        BufferedReader bufferedReader = null;
        StringBuilder content = new StringBuilder();
        try {
            bufferedReader = new BufferedReader(new FileReader(filePath));
            String s = bufferedReader.readLine();
            while (s != null) {
                content.append(s).append("\n");
                s = bufferedReader.readLine();
            }
            return new String(content);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                if (bufferedReader != null) {
                    bufferedReader.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
